package com.bltec.emergency.service.planService.impl;

import com.bltec.emergency.mapper.PlanMapper;
import com.bltec.emergency.model.Plan;
import com.bltec.emergency.service.planService.PlanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class PlanServiceImpl implements PlanService {
    @Resource
    private PlanMapper planMapper;
    @Override
    public boolean add(Plan plan) {
        return planMapper.insert(plan);
    }

    @Override
    public boolean deletePlanById(Long id) {
        return planMapper.setDisableById(id);
    }

    @Override
    public boolean updatePlanById(Plan plan) {
        return planMapper.updatePlanById(plan);
    }

    @Override
    public Plan getPlanById(Long id) {
        return planMapper.getPlanById(id);
    }

    @Override
    public List<Plan> getAll() {
        return planMapper.selectAll();
    }
}
